#ifndef __TBB_FILE_TRANSFER_H__
#define __TBB_FILE_TRANSFER_H__

#include "hal_zigbee_file_transfer.h"

#ifdef __cplusplus
extern "C" {
#endif


#ifdef __cplusplus
}
#endif

#ifndef TAL_ZIGBEE_TRANSFER_EXTERN
#define TAL_ZIGBEE_TRANSFER_EXTERN  extern
#endif

typedef VOID_T (*tal_file_transfer_cmd_handle_t)(TAL_ZCL_MSG_T *msg);
typedef VOID_T (*tal_zigbee_file_transfer_init_fuc_t)(VOID_T);
typedef BOOL_T (*tal_zigbee_start_send_multiple_packet_fuc_t)(UINT16_T addr,UINT16_T cluster,UINT8_T type,UINT8_T cmd,UINT32_T total_size,UINT8_T* data,UINT16_T len,UINT16_T *file_id);

TAL_ZIGBEE_TRANSFER_EXTERN tal_zigbee_file_transfer_init_fuc_t tal_zigbee_file_transfer_init_func;
TAL_ZIGBEE_TRANSFER_EXTERN tal_zigbee_start_send_multiple_packet_fuc_t tal_zigbee_start_send_file_transfer_func;
TAL_ZIGBEE_TRANSFER_EXTERN tal_file_transfer_cmd_handle_t tal_file_transfer_cmd_func;

TAL_ZIGBEE_TRANSFER_EXTERN VOID_T tal_zigbee_file_transfer_init(BOOL_T enable);
TAL_ZIGBEE_TRANSFER_EXTERN BOOL_T tal_inner_get_file_transfer_func_enable(VOID_T);

/*分包组件初始化及功能使能*/
TAL_ZIGBEE_TRANSFER_EXTERN BOOL_T tal_zigbee_file_transfer_config(BOOL_T rec_enable,BOOL_T send_enable,BOOL_T fast_poll,BOOL_T rec_timeout,BOOL_T send_timeout);


/*接收到新的一次分包传输的标志，如果是一次可以接受完整的则该标志表示接受完整并回到应用层；如果是需要分步接收的则该标志表示第一次接收buf满回调应用层*/
TAL_ZIGBEE_TRANSFER_EXTERN BOOL_T rec_new_frame_flag(void);
/*主动结束分包接收，发送end request*/
TAL_ZIGBEE_TRANSFER_EXTERN BOOL_T check_fileid_send_end_request(UINT16_T file_id,END_RESPOND_STATUS_T end_status);


/*分包发送调用入口*/
TAL_ZIGBEE_TRANSFER_EXTERN BOOL_T tal_zigbee_start_send_multiple_packet_handle(UINT16_T addr,UINT16_T cluster,UINT8_T type,UINT8_T cmd,UINT32_T total_size,UINT8_T* data,UINT16_T len,UINT16_T *file_id);
/*主动结束分包发送，停止发送block respond或start notify*/
TAL_ZIGBEE_TRANSFER_EXTERN BOOL_T stop_send_stop_block_respond(void);
/*主动结束分包接收，停止发送block request或start notify respond*/
TAL_ZIGBEE_TRANSFER_EXTERN BOOL_T stop_recv_stop_block_request(void);




#endif